CreatePart
TheCreatePart
method creates a new part in this draft.
ODPart CreatePart (in ODType partType, in ODEditor optionalEditor);
partType
- The part kind for the new part, or
kODNULL
if you will set the part kind later.optionalEditor
- The part editor to be used if the normal binding fails, or
kODNoEditor
if you choose not to specify an editor.- return value
- A reference to the newly created part object.
DISCUSSION
You can call this method only if this draft's current permissions provide write access.This method calls the new part's
InitPart
method to initialize the part object.This method initializes the reference count of the returned part. When you have finished using that part, you should call its
Release
method.If this method executes successfully, it marks this draft as dirty.
EXCEPTIONS
kODErrCannotCreatePart
- Cannot create the specified part object.
SEE ALSO
TheODType
type (page 876).
TheODEditor
type (page 929).
TheODDraft::AcquirePart
method (page 156).
TheODPart::InitPart
method (page 529).
TheODPart
class (page 459).
"Using a Tool Palette to Embed Parts" on page 239 in OpenDoc Programmer's Guide.
"Creating a New Document" on page 292 in OpenDoc Programmer's Guide.
"The InitPart Method" on page 294 in OpenDoc Programmer's Guide.
"Adding an Embedded Part" on page 305 in OpenDoc Programmer's Guide.
Table 11-1 on page 466 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help